<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

namespace Admin\Form;

use Zend\Form\Form as Form;

/**
 * Description of Login
 *
 * @author renato
 */
class Usuario extends Form
{

    public function __construct( $name = null )
    {
        parent::__construct( 'frmCadastroUsuario' );
        $this->setAttribute( 'method', 'post' );
        $this->setAttribute( 'role', 'form' );


        $this->add( array(
            'name'       => 'id',
            'attributes' => array(
                'type'  => 'hidden',
                'id'    => 'id'
            )
        ) );
        $this->add( array(
            'name'       => 'login',
            'attributes' => array(
                'type'  => 'text',
                'id'    => 'login',
                'class' => 'form-control required'
            ),
            'options'    => array(
                'label' => 'Usuário',
            ),
        ) );
        $this->add( array(
            'name'       => 'senha',
            'attributes' => array(
                'type'  => 'password',
                'id'    => 'password',
                'class' => 'form-control required'
            ),
            'options'    => array(
                'label' => 'Senha',
            ),
        ) );
        $this->add( array(
            'name'       => 'nome',
            'attributes' => array(
                'type'  => 'text',
                'id'    => 'nome',
                'class' => 'form-control lg-input required',
            ),
            'options'    => array(
                'label' => 'Nome',
            ),
        ) );
        $this->add( array(
            'name'       => 'email',
            'attributes' => array(
                'type'                => 'text',
                'id'                  => 'email',
                'class'               => 'form-control required',
                'data-ng-controltype' => 'email'
            ),
            'options'    => array(
                'label' => 'Email',
            ),
        ) );
        $this->add( array(
            'name'       => 'telefone',
            'attributes' => array(
                'type'                => 'text',
                'id'                  => 'telefone',
                'class'               => 'form-control required',
                'style'               => 'text-align:center',
                'data-ng-controltype' => 'phone'
            ),
            'options'    => array(
                'label' => 'Telefone',
            ),
        ) );
        $this->add( array(
            'name'       => 'cpf',
            'attributes' => array(
                'type'                => 'text',
                'id'                  => 'cpf',
                'class'               => 'form-control required',
                'style'               => 'text-align:center',
                'data-ng-controltype' => 'cpf'
            ),
            'options'    => array(
                'label' => 'CPF'
            ),
        ) );
        $this->add( array(
            'type'       => 'Zend\Form\Element\Select',
            'name'       => 'perfil',
            'attributes' => array(
                'id'      => 'perfil',
                'class'   => 'form-control required',
                'options' => array('' => 'Selecione', 1 => 'Administrador', 2 => 'Convidado')
            ),
            'options'    => array(
                'label' => 'Perfil'
            ),
        ) );
        $this->add( array(
            'name'       => 'gravar',
            'attributes' => array(
                'type'  => 'button',
                'value' => 'Gravar',
                'id'    => 'gravar',
                'class' => 'btn btn-default'
            ),
        ) );

    }

}
